var BaseStage = app.controller('BaseStage', function($rootScope, $scope, $http,$state,BaseStageData) {
	try{
		$rootScope.showf=false;
		$rootScope.title = '企业阶段';
		$rootScope.tab = 1;
		$scope.step=[];

		//获取企业阶段
		var url=SITE_URL+"index.php?app=baseloginapp&callback=JSON_CALLBACK&act=companystep";
		$http.jsonp(url).success(function(data) {
			$scope.step=data.retval;
		});
		
		$scope.stepclick=function(value,assist){
			if(assist==0){
				return;
			}
			//获取企业阶段
			var url=SITE_URL+"index.php?app=baseloginapp&callback=JSON_CALLBACK&act=setstep&v="+value;
			$http.jsonp(url).success(function(data) {
				showtoast(data.msg);
				$rootScope.go("index");
			});
		}
	}
	catch (e) {
		showcatch(e);
	}
});
BaseStage.BaseStageData=function($q, $http,$stateParams,$rootScope){
	try {
		var data = [];
		var def = $q.defer();
		if(window.localStorage.u==undefined||window.localStorage.u==null||window.localStorage.u==""){			
			$rootScope.go("loginmain");
		}else{
			def.resolve(data);
		}
		
		return def.promise;
	} catch (e) {
		showcatch(e);
	}
}